﻿using System;
using System.Collections.Generic;
using System.Text;
using VSAddInFramework;
using System.Windows.Forms;
using Extensibility;
using EnvDTE;
using EnvDTE80;
using Microsoft.VisualStudio.CommandBars;


namespace VSAddIn
{
    class P4EditCommand:VSCommand
    {
        public P4EditCommand()
            : base("P4Edit", "P4Edit", "Open current file for edit", true, 59,
            (int)vsCommandStatus.vsCommandStatusSupported + (int)vsCommandStatus.vsCommandStatusEnabled,
            (int)vsCommandStyle.vsCommandStylePictAndText, vsCommandControlType.vsCommandControlTypeButton)
        {

        }

        public override bool _Execute()
        {
            MessageBox.Show("P4EditCommand");
            return true;
        }

        public override void CreateCommandUI()
        {
            m_codeWindowButton = VSCommandUIMgr.AddCommandToToolbar(this, "Code Window");
        }

        public override void DestoryCommandUI()
        {
            if (m_codeWindowButton != null)
            {
                m_codeWindowButton.Delete(System.Type.Missing);
            }
        }

        private CommandBarButton m_codeWindowButton;
    }
}
